<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var app = angular.module('checkbox', []);

app.controller('homeCtrl', function ($scope) {
    $scope.selected = [];
    $scope.array_ = angular.copy($scope.array);
    $scope.list = [{
        "id": 1,
            "value": "apple",
            "checked": false
    }, {
        "id": 3,
            "value": "orange",
            "checked": false
    }, {
        "id": 5,
            "value": "pear",
            "checked": false
    }];
    $scope.checkedOrNot = function (id, isChecked, index) {
        console.log("index:" + index + " " + isChecked);

        if (isChecked) {
            $scope.selected.push(id);
        } else {
            var _index = $scope.selected.indexOf(id);
            $scope.selected.splice(_index, 1);
        }
    };
});
		</script>
	</body>
</html>
